﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace QntPlatform.BinanceApi.DApi
{
    public partial class DApiClient
    {

        public  Task<IEnumerable<SymbolPrice>> GetTickerPrice(string symbol=null, string pair=null)
        {
            var req = CreateReq(Prefix + "ticker/price", false);
            if (string.IsNullOrWhiteSpace(symbol))
                req.AddParameter("symbol", symbol);
            else if (string.IsNullOrWhiteSpace(symbol))
                req.AddParameter("pair", pair);
            return req.GetAsync<IEnumerable<SymbolPrice>>().CheckResp(log);
        }

    }
    public class SymbolPrice : DApiDto
    {
        [DataMember(Order = 1)]
        public string Symbol { get; set; }

        [DataMember(Order = 2)]
        public decimal Price { get; set; }

        public string ps { get; set; }
        public string time { get; set; }
    }

}
